import request from "@/utils/request";

// 查询所有的留言消息
export const getMssageList = () => {
  return request({
    url: '/message/list',
  })
}

// 根据名称用户查询留言信息
export const getUserByName = (name) => {
  return request({
    url: '/message/user',
    params: {
      name
    }
  })
}

// 根据留言信息查询
export const getMessage = (content, name) => {
  return request({
    url: '/message/message',
    params: {
      content,
      name
    }
  })
}

// 根据用户名查询
export const getMessageByUser = (name) => {
  return request({
    url: '/message/username',
    params: {
      name
    }
  })
}

// 删除留言信息
export const delMessage = (id, data) => {
  return request({
    url: `/message/del/${id}`,
    method: 'put',
    data
  })
}

// 删除留言用户
export const delUser = (name) => {
  return request({
    url: `/message/deluser`,
    method: 'delete',
    params: {
      name
    }
  })
}